<!DOCTYPE html>
<head>
    <title>数据库运维平台</title>


    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link data-n-head="true" rel="shortcut icon" type="image/x-icon" href="/static/user/img/favicon.ico">
    <!-- 引入 Bootstrap -->
    <link href="/static/bootstrap-4.3.1-dist/css/bootstrap.css" rel="stylesheet">
    <link href="/static/bootstrap-table-1.15.2/dist/bootstrap-table.css" rel="stylesheet">
    <link href="/static/user/css/user1.css" rel="stylesheet">
    <link href="/static/bootstrap-select-1.13.9/dist/css/bootstrap-select.css" rel="stylesheet" type="text/css">
    <link href="/static/fontawesome-free-5.9.0-web/css/all.css" rel="stylesheet" type="text/css">
    <link href="/static/metismenu-3.0.4/dist/metisMenu.min.css" rel="stylesheet" type="text/css">
    <link href="/static/user/css/mm-vertical.css" rel="stylesheet" type="text/css">
    <link href="/static/bootstrap-switch-3.3.4/bootstrap-switch.css" rel="stylesheet" type="text/css">


    <!--    <link href="/static/tableexport-5.2.0/dist/css/tableexport.min.css" rel="stylesheet" type="text/css">-->
    <!-- Latest compiled and minified CSS -->
    <!--    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.14.2/dist/bootstrap-table.min.css">-->

    <style>
        /*.form-group.required .control-label:after {*/
        /*  content:"*";*/
        /*  color:red;*/
        /*}*/
        .redstar:after {
            content:"*";
            color:red;
        }
    </style>
    <!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
    <!-- 注意： 如果通过 file://  引入 Respond.js 文件，则该文件无法起效果 -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="container-fluid">
    <!--最顶部导航栏 -->
    <div class="row clearfix">
        <div class="col-md-12 column">
            <nav class="navbar navbar-expand-lg navbar-light" style="background-color: #e3f2fd;" role="navigation">
                <!--            <nav class="navbar navbar-default " role="navigation">-->
                <div class="navbar-header">
                    <div class="dropdown show">


                        <a class="btn dropdown-toggle " href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <img src="/static/user/img/favicon.ico"  style="width: 25px; height: 25px"
                                 class="d-inline-block align-top" alt=""><strong> &nbsp; 数据库运维平台 - 生产环境</strong>
                        </a>



                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
                            <a class="dropdown-item" href="https://dbsos.huobiidc.com">生产环境</a>
                            <a class="dropdown-item" href="http://dbsos.ops.huobiapps.com">测试环境</a>

                            <a class="dropdown-item" href="http://dbsos.dev-1.huobiapps.com">开发环境</a>
                        </div>
                    </div>

                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon"></span><span class="icon-bar"></span><span
                            class="icon-bar"></span><span class="icon-bar"><</span>
                    </button>
                </div>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="nav navbar-nav ml-auto">
                        <!--                        <li  class="nav-item" >-->
                        <!--                            <a class="nav-link" href="/workflow/"><i class="fas fa-envelope"></i><span class="sr-only">(current)</span></a>-->
                        <!--                        </li>-->
                        <li  class="nav-item" >
                            <a class="nav-link" href="#"><i class="fas fa-user"></i>你好，zhengshaohong</a>
                        </li>
                        <li class="nav-item dropdown">
                            <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">个人设置<strong
                                    class="caret"></strong></a>
                            <ul class="dropdown-menu dropdown-menu-right">



                                <li >
                                    <a class="dropdown-item" href="/logout/">退出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
    </div>

    <!--中间左侧菜单栏和右侧主要内容区，网格分别为2和10 -->
    <div class="row clearfix" style="margin-top: 15px;">
        <div class="col-md-2 ">
            <!--        <div class="navbar-default sidebar">-->
            <nav class="sidebar-nav navbar-collapse">
                <ul class="metismenu" id="menu" >




                    <li >


                        <a href="/index/" ><i class="fas fa-tachometer-alt"></i> Dashboard</a>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-home"></i> SQL审核</a>
                        <ul>


                            <li >

                                <a href="/allworkflow/">SQL上线工单</a></li>


                            <li >

                                <a href="/dbaprinciples/">SQL审核必读</a></li>

                        </ul>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-search"></i> SQL查询</a>
                        <ul>


                            <li >

                                <a href="/sqlquery/"> SQL在线查询</a></li>


                            <li >

                                <a href="/queryapplylist/">查询权限申请</a></li>

                        </ul>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-balance-scale-left"></i> SQL优化</a>
                        <ul>


                            <li >

                                <a href="/slowquery/">SQL慢查日志</a></li>


                            <li >

                                <a href="/sqladvisor/">SQL优化工具</a></li>

                        </ul>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-eye"></i> 核心表巡检</a>
                        <ul>


                            <li >

                                <a href="/coretable/">巡检信息</a></li>

                        </ul>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-database"></i> 数据库信息</a>
                        <ul>


                            <li >

                                <a href="/diagnosis_process/">会话状态信息</a></li>

                        </ul>
                    </li>





                    <li >


                        <a href="#"  class="has-arrow" aria-expanded="false"><i class="fas fa-dove"></i> redis管理</a>
                        <ul>


                            <li >

                                <a href="/redisquery/">键值查询</a></li>


                            <li class="mm-active">

                                <a href="/redisqueryapplylist/">查询申请</a></li>

                        </ul>
                    </li>




                </ul>
            </nav>
        </div>



        <div class="col-md-10 column user-center-div-col-md-10">

            <!-- 自定义操作按钮-->
            <div id="toolbar" class="btn-group">

                <button id="btn_add" type="button" class="btn btn-outline-primary"
                        data-toggle="modal" data-target="#apply">
                    <span aria-hidden="true"></span>申请权限
                </button>
            </div>
            <!-- 申请列表的表格-->
            <div class="table-responsive">
                <table id="dbauthapply-list" data-toggle="table" class="table table-striped table-hover"
                       data-buttons-class="default" style="table-layout:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
                </table>
            </div>
            <!-- 申请权限的模态框-->
            <div class="modal fade" id="apply" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title" id="myModalLabel">申请redis查询权限</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true">&times;</span></button>

                        </div>
                        <div class="modal-body">
                            <div class="form-group">
                                <input type="text" class="form-control" id="title" placeholder="简单说明权限用途">
                            </div>

                            <div class="form-group">
                                <select id="cluster_name" name="cluster_name"
                                        class="selectpicker show-tick form-control bs-select-hidden" data-live-search="true"
                                        data-placeholder="请选择实例:" required>
                                    <option value="is-empty" disabled="" selected="selected">请选择实例:</option>

                                    <option value="ad-feedback-6551">ad-feedback-6551</option>

                                    <option value="aggre-service-ratelimit-6401">aggre-service-ratelimit-6401</option>

                                    <option value="award-center-6548">award-center-6548</option>

                                    <option value="backup-trans">backup-trans</option>

                                    <option value="bigdata-public-6403">bigdata-public-6403</option>

                                    <option value="bigdata-realtime-6527">bigdata-realtime-6527</option>

                                    <option value="broker-6558">broker-6558</option>

                                    <option value="broker-clearing-cancel-6400">broker-clearing-cancel-6400</option>

                                    <option value="broker-clearing-state-6406">broker-clearing-state-6406</option>

                                    <option value="broker-fee-6397">broker-fee-6397</option>

                                    <option value="broker-public-6393">broker-public-6393</option>

                                    <option value="broker-redis-6437">broker-redis-6437</option>

                                    <option value="brokerage-redis">brokerage-redis</option>

                                    <option value="candlestick-6432">candlestick-6432</option>

                                    <option value="cdp-redis-6441">cdp-redis-6441</option>

                                    <option value="cluster-6411">cluster-6411</option>

                                    <option value="cluster-6412">cluster-6412</option>

                                    <option value="cluster-6415">cluster-6415</option>

                                    <option value="cluster-6456">cluster-6456</option>

                                    <option value="cluster-6481">cluster-6481</option>

                                    <option value="cluster-6492">cluster-6492</option>

                                    <option value="cluster-6494">cluster-6494</option>

                                    <option value="cluster-6495">cluster-6495</option>

                                    <option value="cluster-6497">cluster-6497</option>

                                    <option value="cluster-6498">cluster-6498</option>

                                    <option value="cluster-6499">cluster-6499</option>

                                    <option value="cluster-6500">cluster-6500</option>

                                    <option value="cluster-6501">cluster-6501</option>

                                    <option value="cluster-6503">cluster-6503</option>

                                    <option value="cluster-6515">cluster-6515</option>

                                    <option value="cluster-6516">cluster-6516</option>

                                    <option value="cluster-6517">cluster-6517</option>

                                    <option value="cluster-6903">cluster-6903</option>

                                    <option value="cluster-6904">cluster-6904</option>

                                    <option value="cluster-6905">cluster-6905</option>

                                    <option value="cluster-6906">cluster-6906</option>

                                    <option value="cluster-6912">cluster-6912</option>

                                    <option value="cluster-6914">cluster-6914</option>

                                    <option value="cluster-earning-1">cluster-earning-1</option>

                                    <option value="cluster-earning-2">cluster-earning-2</option>

                                    <option value="common-644-index-6570">common-644-index-6570</option>

                                    <option value="common-644-index-redis">common-644-index-redis</option>

                                    <option value="common-prd-cd-session">common-prd-cd-session</option>

                                    <option value="content-home-feed-6553">content-home-feed-6553</option>

                                    <option value="contract-644-match-index-redis">contract-644-match-index-redis</option>

                                    <option value="contract-644-match-index-redis2">contract-644-match-index-redis2</option>

                                    <option value="contract-644-match-index-redis3">contract-644-match-index-redis3</option>

                                    <option value="contract-644-match-redis">contract-644-match-redis</option>

                                    <option value="contract-644-match-redis2">contract-644-match-redis2</option>

                                    <option value="contract-644-prd-cd-orderlimit">contract-644-prd-cd-orderlimit</option>

                                    <option value="contract-644-prd-cd-redis3">contract-644-prd-cd-redis3</option>

                                    <option value="contract-644-prd-center-new-redis">contract-644-prd-center-new-redis</option>

                                    <option value="contract-prd-cd-dbsync1">contract-prd-cd-dbsync1</option>

                                    <option value="contract-prd-cd-dbsync2">contract-prd-cd-dbsync2</option>

                                    <option value="contract-prd-cd-fifo1">contract-prd-cd-fifo1</option>

                                    <option value="contract-prd-cd-fifo2">contract-prd-cd-fifo2</option>

                                    <option value="contract-prd-cd-redis2">contract-prd-cd-redis2</option>

                                    <option value="contract-prd-cd-symbol1">contract-prd-cd-symbol1</option>

                                    <option value="contract-prd-cd-symbol10">contract-prd-cd-symbol10</option>

                                    <option value="contract-prd-cd-symbol11">contract-prd-cd-symbol11</option>

                                    <option value="contract-prd-cd-symbol12">contract-prd-cd-symbol12</option>

                                    <option value="contract-prd-cd-symbol2">contract-prd-cd-symbol2</option>

                                    <option value="contract-prd-cd-symbol3">contract-prd-cd-symbol3</option>

                                    <option value="contract-prd-cd-symbol4">contract-prd-cd-symbol4</option>

                                    <option value="contract-prd-cd-symbol5">contract-prd-cd-symbol5</option>

                                    <option value="contract-prd-cd-symbol6">contract-prd-cd-symbol6</option>

                                    <option value="contract-prd-cd-symbol7">contract-prd-cd-symbol7</option>

                                    <option value="contract-prd-cd-symbol8">contract-prd-cd-symbol8</option>

                                    <option value="contract-prd-cd-symbol9">contract-prd-cd-symbol9</option>

                                    <option value="contract-rc-6565">contract-rc-6565</option>

                                    <option value="crm-6550">crm-6550</option>

                                    <option value="data-migration-6402">data-migration-6402</option>

                                    <option value="dawn-broker-ratelimit-6380">dawn-broker-ratelimit-6380</option>

                                    <option value="dawn-broker-ratelimit-6443">dawn-broker-ratelimit-6443</option>

                                    <option value="dawn-broker-ratelimit-6477">dawn-broker-ratelimit-6477</option>

                                    <option value="dawn-broker-ratelimit-6478">dawn-broker-ratelimit-6478</option>

                                    <option value="dawn-broker-ratelimit-6487">dawn-broker-ratelimit-6487</option>

                                    <option value="dawn-broker-ratelimit-6488">dawn-broker-ratelimit-6488</option>

                                    <option value="dawn-broker-ratelimit-6489">dawn-broker-ratelimit-6489</option>

                                    <option value="dawn-broker-ratelimit-6490">dawn-broker-ratelimit-6490</option>

                                    <option value="defi-gogo-6425">defi-gogo-6425</option>

                                    <option value="defi-hdex-6913">defi-hdex-6913</option>

                                    <option value="defi_chainmonitor-6504">defi_chainmonitor-6504</option>

                                    <option value="devops-6394">devops-6394</option>

                                    <option value="downbroker-token-6547">downbroker-token-6547</option>

                                    <option value="dw-ratelimit-6386">dw-ratelimit-6386</option>

                                    <option value="ehr-6507">ehr-6507</option>

                                    <option value="fiat-currency-6534">fiat-currency-6534</option>

                                    <option value="fin-rpt-6901">fin-rpt-6901</option>

                                    <option value="frey-workflow-6554">frey-workflow-6554</option>

                                    <option value="ga-jp-redis">ga-jp-redis</option>

                                    <option value="ga-jp-redis-ro">ga-jp-redis-ro</option>

                                    <option value="glb-rm-syn-6560">glb-rm-syn-6560</option>

                                    <option value="global-service-redis-6568">global-service-redis-6568</option>

                                    <option value="harbor-6510">harbor-6510</option>

                                    <option value="hb-bit-6429">hb-bit-6429</option>

                                    <option value="hb-china-6396">hb-china-6396</option>

                                    <option value="hb-data-6426">hb-data-6426</option>

                                    <option value="hb-data-6486">hb-data-6486</option>

                                    <option value="hb-defi-6408">hb-defi-6408</option>

                                    <option value="hb-huochain-6409">hb-huochain-6409</option>

                                    <option value="hb-pool-6900">hb-pool-6900</option>

                                    <option value="hb-pool-redis">hb-pool-redis</option>

                                    <option value="hb-session-6424">hb-session-6424</option>

                                    <option value="hbg-app-jp-6453">hbg-app-jp-6453</option>

                                    <option value="hbg-biz-6549">hbg-biz-6549</option>

                                    <option value="hbg-common-6428">hbg-common-6428</option>

                                    <option value="hbg-common-6440">hbg-common-6440</option>

                                    <option value="hbg-common-6482">hbg-common-6482</option>

                                    <option value="hbg-commondb-6434">hbg-commondb-6434</option>

                                    <option value="hbg-margin-fee-6455">hbg-margin-fee-6455</option>

                                    <option value="hbg-order-redis">hbg-order-redis</option>

                                    <option value="hbg-order-web-6446">hbg-order-web-6446</option>

                                    <option value="hbg-order-web-6481">hbg-order-web-6481</option>

                                    <option value="hbg-pp-search-6561">hbg-pp-search-6561</option>

                                    <option value="hbg-prime-6444">hbg-prime-6444</option>

                                    <option value="hbg-prime-box-6532">hbg-prime-box-6532</option>

                                    <option value="hbg-tkn-6427">hbg-tkn-6427</option>

                                    <option value="hbg-tkn-6479">hbg-tkn-6479</option>

                                    <option value="hbg-tkn-6480">hbg-tkn-6480</option>

                                    <option value="hbg-tkn-6482">hbg-tkn-6482</option>

                                    <option value="hbg-tkn-6496">hbg-tkn-6496</option>

                                    <option value="hbg_activity-6519">hbg_activity-6519</option>

                                    <option value="hbg_assets_datax-6556">hbg_assets_datax-6556</option>

                                    <option value="hbg_fiat-6528">hbg_fiat-6528</option>

                                    <option value="hbg_prime_list-6522">hbg_prime_list-6522</option>

                                    <option value="hbp_staking_vote-6505">hbp_staking_vote-6505</option>

                                    <option value="heco-developer-6509">heco-developer-6509</option>

                                    <option value="hgswap-6506">hgswap-6506</option>

                                    <option value="hswap-6508">hswap-6508</option>

                                    <option value="huobi-cloud">huobi-cloud</option>

                                    <option value="huobi-inst-6911">huobi-inst-6911</option>

                                    <option value="huochain-browser-6447">huochain-browser-6447</option>

                                    <option value="im-moment-6902">im-moment-6902</option>

                                    <option value="item_store-6569">item_store-6569</option>

                                    <option value="jg-match-redis">jg-match-redis</option>

                                    <option value="jg-match-redis2">jg-match-redis2</option>

                                    <option value="layer2-6566">layer2-6566</option>

                                    <option value="linear-swap-activity-6564">linear-swap-activity-6564</option>

                                    <option value="liquidity-strategy-redis">liquidity-strategy-redis</option>

                                    <option value="local-jp-redis">local-jp-redis</option>

                                    <option value="local-jp-redis-cfd">local-jp-redis-cfd</option>

                                    <option value="local-jp-redis-cfd-ro">local-jp-redis-cfd-ro</option>

                                    <option value="local-jp-redis-ro">local-jp-redis-ro</option>

                                    <option value="manage-platform-6448">manage-platform-6448</option>

                                    <option value="marketui-redis-6518">marketui-redis-6518</option>

                                    <option value="mds-svc-redis">mds-svc-redis</option>

                                    <option value="mgt-6525">mgt-6525</option>

                                    <option value="mgt-monitor-6410">mgt-monitor-6410</option>

                                    <option value="mgt-redis-6407">mgt-redis-6407</option>

                                    <option value="mulan-ams-dw-6483">mulan-ams-dw-6483</option>

                                    <option value="order-client-6391">order-client-6391</option>

                                    <option value="order-common-6414">order-common-6414</option>

                                    <option value="otc-account-6539">otc-account-6539</option>

                                    <option value="otc-admin-6538">otc-admin-6538</option>

                                    <option value="otc-adv-6537">otc-adv-6537</option>

                                    <option value="otc-campaign-6535">otc-campaign-6535</option>

                                    <option value="otc-chat-6541">otc-chat-6541</option>

                                    <option value="otc-common-6536">otc-common-6536</option>

                                    <option value="otc-option-6493">otc-option-6493</option>

                                    <option value="otc-risk-6540">otc-risk-6540</option>

                                    <option value="otc-stage">otc-stage</option>

                                    <option value="otc-trade-6542">otc-trade-6542</option>

                                    <option value="otc-user-6543">otc-user-6543</option>

                                    <option value="P2P-merchant-tool-6563">P2P-merchant-tool-6563</option>

                                    <option value="pledge-loan-6435">pledge-loan-6435</option>

                                    <option value="proclamation-6909">proclamation-6909</option>

                                    <option value="quantif-orderbook-ac-redis">quantif-orderbook-ac-redis</option>

                                    <option value="quotation-common-6417">quotation-common-6417</option>

                                    <option value="quotation-live-6529">quotation-live-6529</option>

                                    <option value="rc-common-6419">rc-common-6419</option>

                                    <option value="rc-factor-6521">rc-factor-6521</option>

                                    <option value="rc-ip-6526">rc-ip-6526</option>

                                    <option value="redis-quantification">redis-quantification</option>

                                    <option value="sec-uep-6395">sec-uep-6395</option>

                                    <option value="smart-chain-6907">smart-chain-6907</option>

                                    <option value="spider-6530">spider-6530</option>

                                    <option value="star-whitelist-6520">star-whitelist-6520</option>

                                    <option value="start-whitelist-6520">start-whitelist-6520</option>

                                    <option value="submited-state-6436">submited-state-6436</option>

                                    <option value="swap-640-prd-cd-dbsync1">swap-640-prd-cd-dbsync1</option>

                                    <option value="swap-640-prd-cd-dbsync2">swap-640-prd-cd-dbsync2</option>

                                    <option value="swap-640-prd-cd-fifo1">swap-640-prd-cd-fifo1</option>

                                    <option value="swap-640-prd-cd-fifo2">swap-640-prd-cd-fifo2</option>

                                    <option value="swap-640-prd-cd-redis2">swap-640-prd-cd-redis2</option>

                                    <option value="swap-640-prd-cd-symbol1">swap-640-prd-cd-symbol1</option>

                                    <option value="swap-640-prd-cd-symbol10">swap-640-prd-cd-symbol10</option>

                                    <option value="swap-640-prd-cd-symbol11">swap-640-prd-cd-symbol11</option>

                                    <option value="swap-640-prd-cd-symbol12">swap-640-prd-cd-symbol12</option>

                                    <option value="swap-640-prd-cd-symbol2">swap-640-prd-cd-symbol2</option>

                                    <option value="swap-640-prd-cd-symbol3">swap-640-prd-cd-symbol3</option>

                                    <option value="swap-640-prd-cd-symbol4">swap-640-prd-cd-symbol4</option>

                                    <option value="swap-640-prd-cd-symbol5">swap-640-prd-cd-symbol5</option>

                                    <option value="swap-640-prd-cd-symbol6">swap-640-prd-cd-symbol6</option>

                                    <option value="swap-640-prd-cd-symbol7">swap-640-prd-cd-symbol7</option>

                                    <option value="swap-640-prd-cd-symbol8">swap-640-prd-cd-symbol8</option>

                                    <option value="swap-640-prd-cd-symbol9">swap-640-prd-cd-symbol9</option>

                                    <option value="swap-644-prd-cd-orderlimit">swap-644-prd-cd-orderlimit</option>

                                    <option value="swap-644-prd-cd-redis3">swap-644-prd-cd-redis3</option>

                                    <option value="swap-644-prd-match-redis">swap-644-prd-match-redis</option>

                                    <option value="swap-linear-640-prd-dbsync1">swap-linear-640-prd-dbsync1</option>

                                    <option value="swap-linear-640-prd-dbsync2">swap-linear-640-prd-dbsync2</option>

                                    <option value="swap-linear-640-prd-dbsync3">swap-linear-640-prd-dbsync3</option>

                                    <option value="swap-linear-640-prd-fifo1">swap-linear-640-prd-fifo1</option>

                                    <option value="swap-linear-640-prd-fifo2">swap-linear-640-prd-fifo2</option>

                                    <option value="swap-linear-640-prd-fifo3">swap-linear-640-prd-fifo3</option>

                                    <option value="swap-linear-640-prd-redis2-1">swap-linear-640-prd-redis2-1</option>

                                    <option value="swap-linear-640-prd-redis2-2">swap-linear-640-prd-redis2-2</option>

                                    <option value="swap-linear-640-prd-symbol1-1">swap-linear-640-prd-symbol1-1</option>

                                    <option value="swap-linear-640-prd-symbol1-2">swap-linear-640-prd-symbol1-2</option>

                                    <option value="swap-linear-640-prd-symbol1-3">swap-linear-640-prd-symbol1-3</option>

                                    <option value="swap-linear-640-prd-symbol10">swap-linear-640-prd-symbol10</option>

                                    <option value="swap-linear-640-prd-symbol11">swap-linear-640-prd-symbol11</option>

                                    <option value="swap-linear-640-prd-symbol12">swap-linear-640-prd-symbol12</option>

                                    <option value="swap-linear-640-prd-symbol13">swap-linear-640-prd-symbol13</option>

                                    <option value="swap-linear-640-prd-symbol14">swap-linear-640-prd-symbol14</option>

                                    <option value="swap-linear-640-prd-symbol15">swap-linear-640-prd-symbol15</option>

                                    <option value="swap-linear-640-prd-symbol16">swap-linear-640-prd-symbol16</option>

                                    <option value="swap-linear-640-prd-symbol17">swap-linear-640-prd-symbol17</option>

                                    <option value="swap-linear-640-prd-symbol18">swap-linear-640-prd-symbol18</option>

                                    <option value="swap-linear-640-prd-symbol19">swap-linear-640-prd-symbol19</option>

                                    <option value="swap-linear-640-prd-symbol2">swap-linear-640-prd-symbol2</option>

                                    <option value="swap-linear-640-prd-symbol20">swap-linear-640-prd-symbol20</option>

                                    <option value="swap-linear-640-prd-symbol21">swap-linear-640-prd-symbol21</option>

                                    <option value="swap-linear-640-prd-symbol22">swap-linear-640-prd-symbol22</option>

                                    <option value="swap-linear-640-prd-symbol23">swap-linear-640-prd-symbol23</option>

                                    <option value="swap-linear-640-prd-symbol24">swap-linear-640-prd-symbol24</option>

                                    <option value="swap-linear-640-prd-symbol25">swap-linear-640-prd-symbol25</option>

                                    <option value="swap-linear-640-prd-symbol3">swap-linear-640-prd-symbol3</option>

                                    <option value="swap-linear-640-prd-symbol4">swap-linear-640-prd-symbol4</option>

                                    <option value="swap-linear-640-prd-symbol5">swap-linear-640-prd-symbol5</option>

                                    <option value="swap-linear-640-prd-symbol6">swap-linear-640-prd-symbol6</option>

                                    <option value="swap-linear-640-prd-symbol7">swap-linear-640-prd-symbol7</option>

                                    <option value="swap-linear-640-prd-symbol8">swap-linear-640-prd-symbol8</option>

                                    <option value="swap-linear-640-prd-symbol9">swap-linear-640-prd-symbol9</option>

                                    <option value="swap-linear-644-prd-match-redis">swap-linear-644-prd-match-redis</option>

                                    <option value="swap-linear-644-prd-orderlimit">swap-linear-644-prd-orderlimit</option>

                                    <option value="swap-linear-644-prd-redis3-1">swap-linear-644-prd-redis3-1</option>

                                    <option value="swap-linear-644-prd-redis3-2">swap-linear-644-prd-redis3-2</option>

                                    <option value="task-center-6552">task-center-6552</option>

                                    <option value="tkn-redis-6418">tkn-redis-6418</option>

                                    <option value="trans-202203051606">trans-202203051606</option>

                                    <option value="travelrule-6557">travelrule-6557</option>

                                    <option value="uc-cluster-6458">uc-cluster-6458</option>

                                    <option value="uc-jp-redis">uc-jp-redis</option>

                                    <option value="uc-limit-6405">uc-limit-6405</option>

                                    <option value="uc-mc-6398">uc-mc-6398</option>

                                    <option value="uc-redis-6399">uc-redis-6399</option>

                                    <option value="userfeedbacklist-6567">userfeedbacklist-6567</option>

                                    <option value="ventures-6511">ventures-6511</option>

                                    <option value="wallet-redis-6454">wallet-redis-6454</option>

                                    <option value="wallet-redis-6502">wallet-redis-6502</option>

                                    <option value="wlt-redis-6908">wlt-redis-6908</option>

                                    <option value="zkdex-6513">zkdex-6513</option>

                                </select>
                            </div>

                            <div class="form-group">
                                <select id="valid_date" name="valid_date"
                                        class="form-control selectpicker show-tick bs-select-hidden ">
                                    <option value="is-empty" disabled="" selected="selected">请选择授权时间:</option>
                                    <option value="day">一天</option>
                                    <option value="week">一周</option>
                                    <option value="month">一月</option>
                                    <option value="half_a_year">半年</option>
                                    <option value="year">一年</option>
                                </select>
                            </div>

                            <p class="text-danger">提示：权限审核通过后即可进行在线查询，请耐心等待。</p>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-outline-info" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-outline-primary" onclick="applyforprivileges()">提交申请</button>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <!--    &lt;!&ndash;底部部分 &ndash;&gt;-->
    <!--    <div class="row clearfix user-bottom-div" style="background-color: #e3f2fd;">-->
    <!--        <p><strong>数据库运维平台</strong>&nbsp; Developed by DBA-->
    <!--            Team</p>-->
    <!--    </div>-->
</div>
<!-- jQuery (Bootstrap 的 JavaScript 插件需要引入 jQuery，务必先引入jquery js再引入bootstrap js) -->
<script src="/static/bootstrap-4.3.1-dist/js/jquery-3.4.1.min.js"></script>
<script src="/static/bootstrap-4.3.1-dist/js/popper.min.js"></script>
<script src="/static/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/bootstrap-show-password@1.2.1/dist/bootstrap-show-password.min.js"></script>



<script src="/static/bootstrap-table-1.15.2/dist/bootstrap-table.js"></script>
<script src="/static/bootstrap-table-1.15.2/dist/extensions/mobile/bootstrap-table-mobile.min.js"></script>
<script src="/static/bootstrap-table-1.15.2/dist/locale/bootstrap-table-zh-CN.min.js"></script>

<!--表格导出插件-->
<script src="/static/tableExport.jquery.plugin-1.10.5/libs/FileSaver/FileSaver.min.js"></script>
<script src="/static/tableExport.jquery.plugin-1.10.5/libs/js-xlsx/xlsx.core.min.js"></script>
<!--<script src="/static/tableExport.jquery.plugin-1.10.5/libs/jsPDF/jspdf.min.js"></script>-->
<!--<script src="/static/tableExport.jquery.plugin-1.10.5/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js"></script>-->
<script src="/static/tableExport.jquery.plugin-1.10.5/tableExport.min.js"></script>
<script src="/static/bootstrap-table-1.15.2/dist/extensions/export/bootstrap-table-export.js"></script>
<script src="/static/sql-formatter-2.3.3/dist/sql-formatter.min.js"></script>


<script src="/static/bootstrap-select-1.13.9/dist/js/bootstrap-select.js"></script>
<script src="/static/bootstrap-select-1.13.9/dist/js/i18n/defaults-zh_CN.min.js"></script>
<script src="/static/metismenu-3.0.4/dist/metisMenu.min.js"></script>

<!--画图插件-->
<script src="/static/echarts/echarts.min.js"></script>


<!--开关按钮插件-->
<script src="/static/bootstrap-switch-3.3.4/bootstrap-switch.js"></script>


<script src="/static/user/js/formatter.js"></script>
<script src="/static/user/js/genpassword.js"></script>
<script src="/static/user/js/clipboard.min.js"></script>
</body>
<script>

    $('#menu').metisMenu({

        // enabled/disable the auto collapse.
        toggle: true,

        // prevent default event
        preventDefault: true,

        // default classes
        activeClass: 'active',
        collapseClass: 'collapse',
        collapseInClass: 'in',
        collapsingClass: 'collapsing',

        // .nav-link for Bootstrap 4
        triggerElement: 'a',

        // .nav-item for Bootstrap 4
        parentTrigger: 'li',

        // .nav.flex-column for Bootstrap 4
        subMenu: 'ul'

    });

    $(function () {
        $('#menu').metisMenu();

        // bootstrap-slect 指定 bootstrap 的版本为 4
        $.fn.selectpicker.Constructor.BootstrapVersion = '4';

    });
</script>

<script>
    //选择控件初始化
    $("#table_name").selectpicker({
        actionsBox: true, //在下拉选项添加选中所有和取消选中的按钮
        countSelectedText: "已选中{0}项",
        selectedTextFormat: "count > 5"
    });
    $("#db_name_multiple").selectpicker({
        actionsBox: true, //在下拉选项添加选中所有和取消选中的按钮
        countSelectedText: "已选中{0}项",
        selectedTextFormat: "count > 5"
    });

    //获取申请列表
    function redisqueryapplylist() {
        //采取异步请求
        //初始化table
        $('#dbauthapply-list').bootstrapTable('destroy').bootstrapTable({
            method: 'post',
            contentType: "application/x-www-form-urlencoded",
            url: "/getredisqueryapplylist/",
            striped: true,                      //是否显示行间隔色
            cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            pagination: true,                   //是否显示分页（*）
            sortable: true,                     //是否启用排序
            sortOrder: "asc",                   //排序方式
            sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
            pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录
            pageSize: 14,                     //每页的记录行数（*）
            pageList: [20, 30, 50, 100],       //可供选择的每页的行数（*）
            search: true,                      //是否显示表格搜索
            strictSearch: false,                //是否全匹配搜索
            showColumns: true,                  //是否显示所有的列（选择显示的列）
            showRefresh: true,                  //是否显示刷新按钮
            minimumCountColumns: 2,             //最少允许的列数
            clickToSelect: true,                //是否启用点击选中行
            uniqueId: "id",                     //每一行的唯一标识，一般为主键列
            showToggle: true,                   //是否显示详细视图和列表视图的切换按钮
            cardView: false,                    //是否显示详细视图
            detailView: true,                  //是否显示父子表
            locale: 'zh-CN',                    //本地化
            toolbar: "#toolbar",               //指明自定义的toolbar
            queryParamsType: 'limit',
            //请求服务数据时所传参数
            queryParams:
                function (params) {
                    return {
                        limit: params.limit,
                        offset: params.offset,
                        search: params.search
                    }
                },

            columns: [{
                title: '工单名称',
                field: 'title',
                formatter: function (value, row, index) {
                    return "<a href='/applyredis/" + row.apply_id + "/'>" + value + "</a>";
                }
            }, {
                title: '实例',
                field: 'cluster_name'
            }, {
                title: '有效时间',
                field: 'valid_date'
            }, {
                title: '申请人',
                field: 'user_name'
            }, {
                title: '工单状态',
                field: 'status',
                formatter: function (value, row, index) {
                    return workflow_status_formatter(value)
                }
            }, {
                title: '申请时间',
                field: 'create_time'
            }],
            onLoadSuccess: function () {
            },
            onLoadError: function () {
                alert("数据加载失败！");
            },
            onSearch: function (e) {
                //传搜索参数给服务器
                //queryParams(e)
            },
            responseHandler: function (res) {
                //在ajax获取到数据，渲染表格之前，修改数据源
                return res;
            }
        });

    }

    //实例变更获取数据库列表
    $("#cluster_name").change(function () {
        $.ajax({
            type: "post",
            url: "/getdbNameList/",
            dataType: "json",
            data: {
                cluster_name: $("#cluster_name").val()
                // is_master: 'slave'
            },
            complete: function () {
            },
            success: function (data) {
                if (data.status === 0) {
                    var result = data.data;
                    $("#db_name").empty();
                    $("#db_name_multiple").empty();
                    for (var i = 0; i < result.length; i++) {
                        var name = "<option value=\"" + result[i] + "\">" + result[i] + "</option>";
                        $("#db_name").append(name);
                        $("#db_name_multiple").append(name);
                    }
                    $('#db_name').append("<option value=\"is-empty\" disabled=\"\" selected=\"selected\">请选择数据库:</option>\n");
                    $('#db_name').selectpicker('render');
                    $('#db_name').selectpicker('refresh');
                    $('#db_name_multiple').selectpicker('render');
                    $('#db_name_multiple').selectpicker('refresh');
                } else {
                    alert("status: " + data.status + "\nmsg: " + data.msg + data.data);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(errorThrown);
            }
        });
    });

    //数据库变更获取表名称
    $("#db_name").change(function () {
        $.ajax({
            type: "post",
            url: "/getTableNameList/",
            dataType: "json",
            data: {
                cluster_name: $("#cluster_name").val(),
                db_name: $("#db_name").val()
            },
            complete: function () {
            },
            success: function (data) {
                if (data.status === 0) {
                    var result = data.data;
                    $("#table_name").empty();
                    for (var i = 0; i < result.length; i++) {
                        var name = "<option>" + result[i] + "</option>";
                        $("#table_name").append(name);
                    }
                    $('#table_name').selectpicker('render');
                    $('#table_name').selectpicker('refresh');
                } else {
                    alert("status: " + data.status + "\nmsg: " + data.msg + data.data);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(errorThrown);
            }
        });
    });

    //判断页面显示
    $("#priv_type").change(function () {
        //库权限
        if ($("#priv_type").val() === '1') {
            $("#table_div").hide();
            $("#db_name_div").hide();
            $("#db_name_multiple_div").show();

        }
        //表权限
        else if ($("#priv_type").val() === '2') {
            $("#table_div").show();
            $("#db_name_div").show();
            $("#db_name_multiple_div").hide();
        }
    });

    //时间计算
    function addDate(date, days) {
        var d = new Date(date);
        d.setDate(d.getDate() + days);
        var m = d.getMonth() + 1;
        return d.getFullYear() + '-' + m + '-' + d.getDate();
    }

    //提交参数校验
    function applyvalidate() {
        let title = $("#title").val();
        // let priv_type = $("#priv_type").val();
        let cluster_name = $("#cluster_name").val();
        // let db_name = $("#db_name").val();
        // let db_name_multiple = $("#db_name_multiple").val();
        // let table_name = $("#table_name").val();
        let valid_date = $("#valid_date").val();
        // let limit_num = $("#limit_num").val();
        // var apply_remark = $("#apply_remark").val();

        // 参数校验
        if (title && cluster_name &&  valid_date) {
            return true
        }
        else {
            alert("请填写完整!");
            return false
        }

    }

    //提交权限申请
    function applyforprivileges() {
        let title = $("#title").val();
        // var priv_type = $("#priv_type").val();
        let cluster_name = $("#cluster_name").val();
        // var db_name = $("#db_name").val();
        // var db_name_multiple = $("#db_name_multiple").val();
        // var table_name = $("#table_name").val();
        let valid_date = $("#valid_date").val();
        // let limit_num = $("#limit_num").val();
        // var apply_remark = $("#apply_remark").val();

        // 参数校验
        if (applyvalidate()) {
            //时间格式化
            var date = new Date();
            if (valid_date === 'day') {
                valid_date = addDate(date, 1);

            }
            else if (valid_date === 'week') {
                valid_date = addDate(date, 7);
            }
            else if (valid_date === 'month') {
                valid_date = addDate(date, 30);
            }
            else if (valid_date === 'half_a_year') {
                valid_date = addDate(date, 180);
            }
            else if (valid_date === 'year') {
                valid_date = addDate(date, 365);
            }
            else {
                valid_date = addDate(date, 1);
            }


            //禁用按钮
            $('button[type=button]').addClass('disabled');
            $('button[type=button]').prop('disabled', true);
            //提交请求
            $.ajax({
                type: "post",
                url: "/applyredisprivileges/",
                dataType: "json",
                data: {
                    title: title,
                    cluster_name: cluster_name,
                    valid_date: valid_date
                },
                complete: function () {
                    $('button[type=button]').removeClass('disabled');
                    $('button[type=button]').prop('disabled', false);
                },
                success: function (data) {
                    if (data.status === 0) {
                        $('#apply').modal('hide');
                        location.href = '/redisqueryapplylist/'
                    }
                    else {
                        alert(data.msg);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(errorThrown);
                }
            });
        }
    }

    //初始化数据
    $(document).ready(function () {
        redisqueryapplylist();
    });

</script>

</html>
